<?php

class PageController extends Zend_Controller_Action
{
	protected $_datas;
	
	public function init()
    {
		$this->pages = new CMS_Page();
		$this->document = new CMS_Document();
    }

    public function pageAction()
    {
		
		
		$id =  $this->document->getId($this->_getParam(1));
		
		
		
		
		
		$sel1 = $this->pages->select()->where('document_id=\''.$id.'\'');
		$res1 = $this->pages->fetchAll($sel1);
		
		$sel2 = $this->document->select()->where('id=\''.$id.'\'');
		$res2 = $this->document->fetchRow($sel2);
		
		$this->view->assign('pagesDatas', $res1->toArray());
		$this->view->assign('documentData', $res2->toArray());
    }
	
	public function testAction (){
		$this->view->assign('title', 'My 1st List view');
	}


}

